home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / HackintoshBiblev1.3.sit / Hackintosh Bible v1.3.rsrc / TEXT_151.txt < prev    next >
Text File  |  1996-11-10  |  33KB  |  391 lines

  1. `Beta Notes: 10/17/91
  2.  
  3. The following bold entries constitute a tentative outline for topics to dicuss in detail.  Some of these topics will require a fair amount of research on my part - in particular, the Eve and Encryption sections will take some time.  After this section come the live cracks.  These represent an attempt to take a novice cracker through every step of the cracking process detailing choices and decisions that I would make as I go and why I would make them.
  4.  
  5. Any feedback would be greatly appreciated - especially from any novice crackers who find parts of this document incomprehensible.  Note that this is a rough draft - there are bound to be errors although hopefully no logical ones (just syntactical and/or spelling).
  6.  
  7. Determining where to start looking
  8.  
  9. 1) Types of protection
  10.  a) Serial number schemes
  11.  b) Registration codes
  12.  c) Network serial checks [AppleTalk driver stuff]
  13.  d) Hardware plugs - see below
  14.  e) Encryption - see below
  15.  f) Time stamps
  16.  g) Key disk
  17.  
  18. How to break into programs
  19.  
  20. 1) Trap interrupts
  21.  a) Dialog/Alert traps
  22.  b) MenuSelect
  23.  c) InitFonts etc.
  24. 2) Manual entrance of TMON [Good luck]
  25. 3) Automatic TMON entrance via code modification [_Debugger trap insertion]
  26.  a) Determining an address with Nosy
  27.  b) Determining an address from the Jump Table
  28.  c) 
  29.  
  30. Using TMON, Nosy, and ResEdit together
  31.  
  32. 1) Determining address offsets
  33. 2) Nosy vs TMON
  34.  a) Why Nosy "feels better"
  35.  b) Why TMON is virtually omniscient
  36.  
  37. TMON Tricks
  38.  
  39. 1) TMON tricks with register values, flags, and instruction modification
  40. 2) One step ModalDialog hassles [Serial number schemes]
  41. 3) TMON Pro shortcuts
  42.  
  43. Determining the type of crack to apply
  44.  
  45. 1) Bypasses vs cracks
  46. 2) Finding the key code
  47. 3) Branch switching
  48.  a) Mention something about branch op-codes - 2 and 4 byte instructions and offsets
  49. 4) Flag/variable modification
  50. 5) Code modification
  51.  
  52. Everything you always wanted to know about the CODE 0 Jump Table.
  53.  
  54. 1) What it is and how it works
  55. 2) Locating an entry point
  56. 3) Modifications
  57.  
  58. Hardware plugs
  59.  
  60. 1) General tips [Device Manager stuff]
  61. 2) Eve bullshit
  62.  
  63. Encrypted Code
  64.  
  65. Unless you are one hell of a genius at cryptology and have lots of time to kill, the encrypted CODE resources will have to be de-crypted and written back to the program.  Here is why:  to decrypt itself, a program will usually either take a known seed number and use it on each encrypted byte of the code or else it will start with some byte in the code and do a forward decrypt,  i.e. the first byte decrypts the second byte, the new second byte decrypts the third byte, and so on.  A simple method might be to have some code that looks like this:
  66.  
  67.  MOVE    #1000,D0
  68.  LEA    encryptedshit,A0
  69.  LEA    encryptedshit-1,A1
  70. loop1    EOR.L    (A1)+,(A0)+
  71.  DBRA    D0,loop1
  72. encryptedshit    Here is where the encrypted gibberish begins.
  73.  
  74. This is a simple example, but note how it functions.  D0 gets the number of longwords to decrypt, A0 is the destination (where the decrypted stuff will go - which is right back over the encrypted stuff) and A1 gets the decrypting key which is the long word that was previously decrypted.  Then the code simply loops D0 times writing over the encrypted code with the decrypted code.  After this code has finished, the program continues execution right where the encrypted (and now decrypted) code begins.  Now cosider: somewhere in the encrypted stuff is the error check that you have to modify.  This will be simple enough to locate assuming that you can run the decryption routine and then immediately regain control in TMON.  The problem is that when you go to modify the error check so that it always passes, the modification screws up the decryption routine.  This is because the decryption routine requires the exact original values to run properly since these values are the keys that the code uses.  So a crack using traditional methods requires that you not only change the error branch, but that you also change every other encrypted value such that the decryption routine still runs properly - no small feat!
  75.  
  76. A much more feasable method would be to decrypt the code, make the necessary modifications to the error routine, and then disable the decryption routine (just branching around it would do) and writing the whole mess (un-encrypted) back to the original code resource.
  77.  
  78. So much for the theory, now if I could just crack one of these suckers...
  79.  
  80.  
  81. Live Cracks
  82.  
  83.  
  84. MultiClip 2.0
  85.  
  86. This program uses a network checking algorithm to determine whether multiple copies with the same serial number are currently running - if you don't use this program on a network, you will never see the error.
  87.  
  88. Step 1:  Where to start looking.
  89.  
  90. There are actually several good places to begin looking for the protection (especially if you have already cracked it - but I will assume that you have not).  First of all, since the program scans the network, it is probably using the _Open Trap somewhere early in its code to to access the Appletalk driver.  Second, it displays an error dialog (or alert) so we could open it up in Resedit, find the error dialog (and note its ID # for later use) and then Nosy it and look at procedures that call ModalDialog or one of the Alert traps to try and find the one that displays the dialog with the proper ID #.  Third, we could have TMON trap either 1) ModalDialog if it is a dialog or 2) StopAlert, CautionAlert or NoteAlert if it is an Alert and begin tracing from that point backwords.  Fourth, we could just Nosy it and start from the top (the slow way).
  91.  
  92. Whenever a program displays an error dialog (not a serial number dialog which seems to be in vogue these days) I almost always find the ID # of the dialog or alert and begin looking at procs in Nosy, so let's start there.  In Resedit, we note that it is Dialog (and not Alert) #128 that is the problem.  On to Nosy.  After Nosy analyzes the INIT resource, open up the Trap Refs List under the Display menu and scroll down to GetNewDialog.  Here you will find two listings: ASKNAME and PUTREGISTERDLOG.  Since there are only two we can quickly check them both out (if there were a bunch, I would probably try a different method).  First let us look at ASKNAME -  here is the listing down to the GetNewDialog:
  93.  
  94.    42BA:                                 QUAL    ASKNAME ; b# =184  s#1  =proc54
  95.  
  96.                                  vdu_1     VEQU  -26
  97.                                  vdu_2     VEQU  -18
  98.                                  vdu_3     VEQU  -12
  99.                                  vdu_4     VEQU  -10
  100.                                  vdu_5     VEQU  -8
  101.                                  param1    VEQU  8
  102.                                  funRslt   VEQU  12
  103.     42BA:                                 VEND    
  104.  
  105.                                ;-refs - com_43    MYFILTERFORNAME  
  106.  
  107.     42BA: 4E56 FFE6      'NV..'  ASKNAME  LINK    A6,#-$1A
  108.     42BE: 48E7 0318      'H...'           MOVEM.L D6-D7/A3-A4,-(A7)
  109.     42C2: 2C2E 0008      2000008          MOVE.L  param1(A6),D6
  110.     42C6: 42A7           'B.'             CLR.L   -(A7)
  111.     42C8: 4EBA E642      100290C          JSR     proc19
  112.     42CC: 285F           '(_'             POP.L   A4
  113.     42CE: 486E FFF8      200FFF8          PEA     vdu_5(A6)
  114.     42D2: A874           '.t'             _GetPort ; (VAR port:GrafPtr) 
  115.     42D4: 42A7           'B.'             CLR.L   -(A7)
  116.     42D6: 302C 001E      '0,..'           MOVE    30(A4),D0
  117.     42DA: D07C 0014      '.|..'           ADD     #20,D0
  118.     42DE: 3F00           '?.'             PUSH    D0
  119.     42E0: 42A7           'B.'             CLR.L   -(A7)
  120.     42E2: 70FF           'p.'             MOVEQ   #-1,D0
  121.     42E4: 2F00           '/.'             PUSH.L  D0
  122.     42E6: A97C           '.|'             _GetNewDialog ; (DlgID:INTEGER; wStorage:Ptr; behind:WindowPtr):DialogPtr 
  123.  
  124. The first thing to do is to locate the _GetNewDialog and determine its associated parameters: actually all we care about is the first parameter, the ID #.  Tracing backwords, we see that -1 is the third parm, 0 is the second parm, and 30(A4) + #20 (from the ADD #20,D0) is the first parm.  Well, we have a problem here.  Instead of a nice plain ID # being passed to GetNewDialog, the ID # is hidden on the stack frame somewhere.  At this point it is best to mark this proc as indeterminite and go on to the next one.  If we must come back to this one then we will have to figure out if ID #128 is valid for this proc and go from there.  So let us look at PUTREGISTERDLOG
  125.  
  126.   33AC:                                 QUAL    PUTREGISTERDLOG ; b# =141  s#1  =proc35
  127.  
  128.                                vdb_1     VEQU  -286
  129.                                vdb_2     VEQU  -278
  130.                                vdb_3     VEQU  -276
  131.                                vdb_4     VEQU  -274
  132.                                vdb_5     VEQU  -272
  133.                                vdb_6     VEQU  -270
  134.                                vdb_7     VEQU  -268
  135.                                vdb_8     VEQU  -264
  136.                                vdb_9     VEQU  -262
  137.                                vdb_10    VEQU  -256
  138.                                param1    VEQU  8
  139.   33AC:                                 VEND    
  140.  
  141.                                ;-refs - INIT1     
  142.  
  143.                                PUTREGISTERDLOG
  144.   33AC: 4E56 FEE2      'NV..'           LINK    A6,#-$11E
  145.   33B0: 2F0C           '/.'             PUSH.L  A4
  146.   33B2: 206E 0008      2000008          MOVEA.L param1(A6),A0
  147.   33B6: 43EE FF00      200FF00          LEA     vdb_10(A6),A1
  148.   33BA: 703F           'p?'             MOVEQ   #63,D0
  149.   33BC: 22D8           '".'    ldb_1    MOVE.L  (A0)+,(A1)+
  150.   33BE: 51C8 FFFC      10033BC          DBRA    D0,ldb_1
  151.   33C2: 42A7           'B.'             CLR.L   -(A7)
  152.   33C4: 3F3C 0080      '?<..'           PUSH    #128
  153.   33C8: 42A7           'B.'             CLR.L   -(A7)
  154.   33CA: 70FF           'p.'             MOVEQ   #-1,D0
  155.   33CC: 2F00           '/.'             PUSH.L  D0
  156.   33CE: A97C           '.|'             _GetNewDialog ; (DlgID:INTEGER; wStorage:Ptr; behind:WindowPtr):DialogPtr 
  157.  
  158.  
  159. Once again, find the GetNewDialog and determine the parms.  Here we have -1 for the third, 0 for the second, and lo and behold, 128 for the first.  This is definately our procedure.  Note that this is an extremely easy example as no attempt has been made to disguise the ID # - it is clearly 128, the value we have been looking for all along.
  160.  
  161. Determining how to implement the crack.
  162.  
  163.  The obvious place to start looking is just before the error dialog has been loaded.  Here is that section of code from the above procedure:
  164.  
  165. LINK    A6,#-$11E
  166. PUSH.L  A4
  167. MOVEA.L param1(A6),A0
  168. LEA     vdb_10(A6),A1
  169. MOVEQ   #63,D0
  170. ldb 1    MOVE.L  (A0)+,(A1)+
  171. DBRA    D0,ldb_1     Next comes the code we just looked at
  172. CLR.L   -(A7)
  173. PUSH    #128
  174. CLR.L   -(A7)
  175. MOVEQ   #-1,D0
  176. PUSH.L  D0
  177. _GetNewDialog
  178.  
  179. As we look at this code, keep in mind what it is that we are looking for.  We know that the program is capable of loading without this error, so somewhere it has to be checking the network and then either branching to the error code (if it detects a copy of itself) or else branching around the error code.  So we need to find the branch that is causing this segment of code to execute.  A quick scan of the code that precedes the error dialog code should reveal nothing of interest.  A Link followed by a 63 word Move Loop - no branches of any consequence whatsoever.  If you are wondering why we can immediately eliminate the DBRA  D0,ldb1 (after all, it is a branch) then ask yourself this:  1st, where does the branch go? Answer: to the line above the branch instruction.  2nd, what (if any) conditions is it checking? Answer: it checks to see if D0 (an obvious loop counter in this case) is equal to zero.  If the branch does not either 1) branch directly to the error code (in this case it would have to be branching to the CLR.L -(A7) ) or 2) branch around the error code (somewhere after the GetNewDialog and the ensuing ModalDialog and probably even an ensuing DisposeDialog) then the branch is almost certainly a bad candidate.  You particulaly should be able to immediately eliminate loop terminator branches like the one above.
  180.  
  181. Well, since we have eliminated the only branch in this procedure above the GetNewDialog, we will have to look elsewhere.  The next obvious place to look is in the procedure that called this one.  Again Nosy makes this a snap.  Take a look at the line right above the code listing that read refs - INIT1.  The refs line tells you every procedure that calls the one you are currently looking at.  Luckily, there is only one, so let us look at it next.  Since this is a long procedure, I am only listing the section that surrounds the JSR PUTREGISTERDLOG line.  I should also mention that I am writing this with a copy that I cracked a while ago and in un-cracking it for this document, could not remember exactly what the changed code was.  I will show you where your code listing might differ from mine below:
  182.  
  183.    196: 4268 0004      'Bh..'           CLR     4(A0)
  184.    19A: 4228 0006      'B(..'           CLR.B   6(A0)
  185.    19E: 4228 0007      'B(..'           CLR.B   7(A0)
  186.    1A2: 43FA 036E      1000512          LEA     data2,A1    ; len= 1
  187.    1A6: 45E8 0009      'E...'           LEA     9(A0),A2
  188.    1AA: 4EBA 0392      100053E          JSR     proc2
  189.    1AE: 43FA 03A2      1000552          LEA     data4,A1    ; 'Multi'
  190.    1B2: 4EBA 038A      100053E          JSR     proc2
  191.    1B6: 43FA 03AC      1000564          LEA     data7,A1    ; len= 2
  192.    1BA: 4EBA 0382      100053E          JSR     proc2
  193.    1BE: 4A6E FFEC      200FFEC          TST     vab_2(A6)
  194.    1C2: 6756           100021A          BEQ.S   lab_13
  195.    1C4: 4FEF FFFE      'O...'           LEA     -2(A7),A7
  196.    1C8: 2F2E FFEE      200FFEE          PUSH.L  vab_3(A6)
  197.    1CC: 4EBA 2C88      1002E56          JSR     proc29
  198.    1D0: 301F           '0.'             POP     D0
  199.    1D2: 6646           100021A          BNE.S   lab_13
  200.    1D4: 4FEF FFCE      'O...'           LEA     -50(A7),A7
  201.    1D8: 204F           ' O'             MOVEA.L A7,A0
  202.    1DA: 317C FFF6 0018 '1|....'         MOVE    #$FFF6,ioCRefNum(A0)
  203.    1E0: 216E FFEE 001E 200FFEE          MOVE.L  vab_3(A6),ioSEBlkPtr(A0)
  204.    1E6: 317C 00FC 001A '1|....'         MOVE    #252,CSCode(A0)
  205.    1EC: A004           '..'             _Control ; (A0|IOPB:ParamBlockRec):D0\OSErr 
  206.    1EE: 4FEF 0032      'O..2'           LEA     50(A7),A7
  207.    1F2: 206E FFEE      200FFEE          MOVEA.L vab_3(A6),A0
  208.    1F6: A01F           '..'             _DisposPtr ; (A0/p:Ptr) 
  209.    1F8: 486D FFFC           -4          PEA     glob1(A5)
  210.    1FC: A86E           '.n'             _InitGraf ; (globalPtr:Ptr) 
  211.    1FE: A8FE           '..'             _InitFonts  
  212.    200: A912           '..'             _InitWindows  
  213.    202: A9CC           '..'             _TeInit  
  214.    204: 42A7           'B.'             CLR.L   -(A7)
  215.    206: A97B           '.{'             _InitDialogs ; (resumeProc:ProcPtr) 
  216.    208: A850           '.P'             _InitCursor  
  217.    20A: 42B8 0A6C         $A6C          CLR.L   DeskHook
  218.    20E: 487A 0302      1000512          PEA     data2       ; len= 1
  219.    212: 4EBA 3198      10033AC          JSR     PUTREGISTERDLOG
  220.    216: 4EFA 0316      100052E          JMP     com_2
  221.    21A: 4227           'B''    lab_13   CLR.B   -(A7)
  222.    21C: A99B           '..'             _SetResLoad ; (AutoLoad:BOOLEAN) 
  223.    21E: 42A7           'B.'             CLR.L   -(A7)
  224.    220: 2F3C 4452 5652 '/<DRVR'         PUSH.L  #'DRVR'
  225.    226: 487A 2156      100237E          PEA     data35      ; len= 12
  226.    22A: A9A1           '..'             _GetNamedResource ; (theType:ResType; name:Str255):Handle 
  227.    22C: 1F3C 0001      '.<..'           PUSH.B  #1
  228.    230: A99B           '..'             _SetResLoad ; (AutoLoad:BOOLEAN) 
  229.   
  230. First off, we need to find the line that calls the error procedure we just finished looking at.  In this case the line will be either JSR PUTREGISTERDLOG or BSR PURREGISTERDLOG.  We find the correct line just above lab 13.  Now, quickly note the structure we are dealing with: we have JSR PUTREGISTERDLOG (which does all the error dialog stuff) followed by a JMP instruction.  So the program is leaving the main flow of control after doing the error dialog.  This is important because we can see that logically, there should be a branch that skips this piece of code and continues on with lab 13.  If we scan backwords from the JSR PUT... we see a bunch of Initialization traps preceded by some Moves - but then notice this code:
  231.  
  232. JSR     proc2
  233. TST     vab_2(A6)
  234. BEQ.S   lab_13
  235. LEA     -2(A7),A7
  236. PUSH.L  vab_3(A6)
  237. JSR     proc29
  238. POP     D0
  239. BNE.S   lab_13
  240.  
  241. Here is where I forget what the original code looked like so your listing might say BEQ.S lab 13 (for the second branch that is).  Anyways, this code looks really good since it branches around the error section.  At this point, we might hazard a guess and simply make these Branch instructions always execute by changing them to BRA lab 13.  This might be an incorrect crack since the program could be making other checks above this code - we can eliminate this chance by continuing scanning upwards looking for references to lab 13 until the beginning of this procedure.  What I would do in a case like this is make a real fast check of about 50 or so lines of code above this looking for branches refering to lab 13.  If I find one, modify it...if not, then make the crack and test it.  If the crack fails, then I would know to keep looking.
  242.  
  243. A quick note:  The flow of the program seems to suggest that merely changing the first branch from BEQ to BRA would suffice since this instruction always executes (it is not branched around anywhere) and once this instruction branches to lab 13 there would be no need to change the second branch.  However, I am writing this having already cracked this program and the method I used was to change the second branch only.  Since I know that this works and cannot test any other method (not having a network at my disposal), I will proceed in this manner.  The would-be cracker could certainly try changing the first branch and it looks to me as if this would work.
  244.  
  245. So how is the crack applied?  Well, in this case, it looks like the program branches to lab 13 only if the serial check is OK (i.e. there are no extra copies running on the network) so we need to to make this branch always execute.  The easiest way to do this is to change the BNE.S lab 13 to BRA.S lab 13 - branch not equal turns into branch always.  So, simply pop over to Resedit and open the proper resource (INIT in this case).  To determine the ID of the resource, look at the top of the procedure window in Nosy.  The first line will contain an s# followed by a number.  This is the segment number or ID # of the resource (in this case it is obvious since there is only one INIT resource, but for CODE resources this is really handy).  Once the resource is open (make sure you do not have the Resedit disassembler running - if you do, select Open Using Hex Editor from the Resource menu) scan down to the line that most closely matches the line you want to modify - in this case our line is 1D2 so find line 1D0 in Resedit and look over 2 bytes.  There should be the code 6646.  Just click in front of the 66, backspace to delete it,  and type 60 (You can find these op-code numbers in the Cracker's Guide Part 1).  Now quit and save changes and the crack is complete.
  246.  
  247. Infini-d 1.1
  248.  
  249. This program uses the common serial number / personalize dialog scheme.
  250.  
  251. Step 1:  Where to start looking.
  252.  
  253. We have two good options here: 1) Find the Dialog ID # in Resedit and use Nosy's Trap Refs List or 2) trap ModalDialog in TMON and start tracing from there.  I tend to use the second method, usually because I can implement the crack on the fly in TMON and actually run the program.  Then I go back later and figure out how do a full crack with Nosy.  Note that withe the second method we do not have to go through every stupid dialog in the program.  Rather we can simply find the unfriendly ModalDialog and let TMON tell us which code resource we are in.
  254.  
  255. First, drop into TMON and set a trap intercept for _ModalDialog then exit TMON and launch Infini-D.  TMON will proceed to stop execution at the first ModalDialog trap.  Since it is possible for a program to have ModalDialog traps before the one that actually does the serial number stuff my first step is to immediately exit TMON and keep track of how many ModalDialogs occur before the serial number dialog comes up.  In this case it is the first ModalDialog, so I would have to then quit and start over, this time not exiting TMON when the trap occurs.
  256.  
  257. Once you are in TMON, open an Assembly window to (PC) to look at the code that is executing.  I forget exactly, but essentially what you would see is the ModalDialog trap followed by a couple of meaningless instructions and an RTS.  Since nothing happens after the ModalDialog, we would need to Step through the RTS to get back to the procedure that called this one.
  258.  
  259. I should make a quick note here:  this technique of making an on the fly crack via TMON usually means that you are going to ruin the application, i.e. you are going to end up with a serialized program that no longer needs to be cracked.  This is not a true crack, rather this is a bypass - once this is done, the program is personalized and ready to run; in a sense you are letting the program crack itself.  If you wanted to make a true cracked copy, you would have to look at exactly which branches were modified in TMON and then go into Resedit and change the same instructions (with an un-serialized copy of the application).
  260.  
  261. OK, enough about that.  Here is the code you would see:
  262.  
  263. PEA      $157A(A5)
  264. MOVE.L  $000C(A6),-(A7)
  265. _ModalDialog
  266. UNLK      A6
  267. RTS
  268.  
  269. Since the procedure ends right after the ModalDialog call, we need to step through the RTS to see what called this procedure...and here is that code:
  270.  
  271. 001E50B4: LINK.W    A6,#$FFFE
  272. 001E50B8: PEA      `FFFE(A6)
  273. 001E50BC: CLR.L      -(A7)
  274. 001E50BE: JSR      $1572(A5)
  275. 001E50C2: ADDQ.L    #8,A7
  276. 001E50C4: CMPI.W    #$0001,`FFFE(A6)
  277. 001E50CA: BEQ.S      ^$001E50D8     
  278. 001E50CC: CMPI.W      #$0002,`FFFE(A6)
  279. 001E50D2: BEQ.S      ^$001E50D8     
  280. 001E50D4: MOVEQ      #$00,D0
  281. 001E50D6: BRA.S      ^$001E50DA     
  282. 001E50D8: MOVEQ      #$01,D0
  283. 001E50DA: TST.W      D0
  284. 001E50DC: BEQ.S      ^$001E50B8     
  285. 001E50DE: CMPI.W    #$0001,`FFFE(A6)
  286. 001E50E4: BNE.S      ^$001E50EA     
  287. 001E50E6: MOVEQ      #$01,D0
  288. 001E50E8: BRA.S      ^$001E50EC     
  289. 001E50EA: MOVEQ      #$00,D0
  290. 001E50EC: UNLK      A6
  291. 001E50EE: RTS
  292.  
  293. Well, there is quite a bit of comparing and branching going on here so we had better see if we can figure out what is happening.  After the Link, the dialog handle is pushed on the stack, space for a return value (or maybe a parameter with value 0) is put on the stack and then the ModalDialog procedure is called.  This is pretty standard.  Next, the stack is restored to its original value and something is compared to 1, branch if so, then compare the same thing to 2 and branch if so.  Notice an important thing here, namely that this procedure never calls GetDItem or GetIText nor does it call any more subroutines so this procedure cannot be the one that checks the serial number.  So it is probably a safe bet that this procedure is testing to see what exactly the user did - hit OK? hit Cancel? Type in a keystroke?  Assuming for the moment that this is the case, take a wild guess what the various dialog item numbers are?  You guessed it...1 is the OK button, 2 is the Cancel button.  Now look at the code and you can quickly see what is happening (still assuming our item number theory is correct).  First, if the item number hit was one (OK button) then branch down, and put a 1 in D0.  If the item number hit was 2 (Cancel button) then do the same thing.  Otherwise put a zero in D0.  Finally, TST D0 and if it was 0 (neither button hit) then loop back and call ModalDialog again.  At this point the program knows one of the buttons was hit.  So, if it was not the OK button, branch down and put 0 in D0 otherwise put a 1 in D0 (so that's Cancel = 0, OK = 1).  When we look at the procedure that called this one, we know that D0 will tell that procedure what happened (either OK or Cancel).
  294.  
  295. Note that this is one of those problem ModalDialog calls that exits everytime you hit a keystroke so you cannot just type in your name and serial number, hit OK to get back to TMON, and crack the sucker.  Rather you have to either 1) settle for only typing in one letter before you crack it or 2) set a breakpoint just past the part were it tests for the OK button being hit, clear the ModalDialog trace, and exit - TMON won't interrupt until you hit the OK button and the breakpoint is encountered.
  296.  
  297. Finally, here is the last piece of code - the procedure that called the above procedure:
  298.  
  299. 001E4FBE: ADDQ.L  #6,A7
  300. 001E4FC0:JSR    ^$001E50B4    
  301. 001E4FC4: MOVE.W  D0,`FFFE(A6)     Here is where we returned from the above procedure. 1 = OK, 0 = Cancel
  302. 001E4FC8: CMPI.W  #$0001,`FFFE(A6)
  303. 001E4FCE:BNE.S    ^$001E5012     Branch if Cancel hit
  304. 001E4FD0:PEA    `FEF8(A6)
  305. 001E4FD4: MOVE.W  #$000A,-(A7)
  306. 001E4FD8:JSR    ^$001E4F58    
  307. 001E4FDC: ADDQ.L  #6,A7     
  308. 001E4FDE:PEA    `FEF8(A6)
  309. 001E4FE2:JSR    ^$001E52AC    
  310. 001E4FE6: ADDQ.L  #4,A7
  311. 001E4FE8: MOVE.W  D0,`FFFC(A6)
  312. 001E4FEC:TST.W    `FFFC(A6)
  313. 001E4FF0:BNE.S    ^$001E5012    
  314. 001E4FF2: MOVE.W  #$0001,-(A7)
  315. 001E4FF6:CLR.W    -(A7)
  316. 001E4FF8: MOVE.W      #$0034,-(A7)
  317. 001E4FFC:JSR    $107A(A5)
  318. 001E5000: ADDQ.L  #6,A7
  319. 001E5002: MOVE.L  582(A5),-(A7)
  320. 001E5006: MOVE.W  #$000A,-(A7)
  321. 001E500A:CLR.W    -(A7)
  322. 001E500C: MOVE.W  #$7FFF,-(A7)
  323. 001E5010: SelIText
  324. 001E5012: CMPI.W  #$0001,`FFFE(A6)    True if OK was hit
  325. 001E5018:BNE.S    ^$001E5020    
  326. 001E501A:TST.W    `FFFC(A6)     Unknown: returned value from JSR above
  327. 001E501E: BEQ.S    ^$001E4FC0
  328. 001E5020: CMPI.W  #$0001,`FFFE(A6)
  329. 001E5026:BNE.S    ^$001E5070    
  330. 001E5028:PEA    `FF38(A6)
  331. 001E502C: MOVE.W  #$0006,-(A7)
  332. 001E5030:JSR    ^$001E4F58    
  333. 001E5034: ADDQ.L  #6,A7
  334.  
  335. Well, there is a lot of crap here and if you decided to trace the two JSRs you would be in for a long ride.  The first thing to try is to deduce what will happen based on what we already know - we know that if the wrong serial number is entered, the program will go back to ModalDialog to let you change it.  So we need to find a branch that goes back above line 1E4FC0 (the ModalDialog JSR).  If we can find that branch and avoid it, we should be safe.  So we will start tracing down from where the program returned, not making any assumptions yet, but looking at where the branches go.  Right away you will note two JSRs.  Take a look at the parameters passed, and you will note the pair of PEA FEF8(A6) instructions.  So this same piece of information is being passed to both subroutines - nothing to write home about, but interesting.  The real key you should notice here is that there is a TST and BNE after the second subroutine.  This is the first chance the program has to make any decisions (although what decisions we don't know).  Let's assume this branch does not execute (you could assume either way and wind up with the answer) i.e. FFFC(A6) = 0 - some stuff happens that we don't care too much about yet, some text is selected, and the button is tested.  If it was OK, the return value from the second JSR is TSTed and if it was zero (which we are assumming), branch back to 1E4FC0 - back to the ModalDialog JSR.  So this route is incorrect.  Going back, we now need to assume that the branch at line 1E4FF0 did execute.  This time, we jump right to the button check, skip the branch since OK was hit, and again TST the return value from the second JSR.  Since the branch executed, this value cannot be zero, so execution proceeds.  Looking down a few lines we note that there does not seem to be any more branches back to the ModalDialog JSR so we can tentatively assume that this is the end of the protection.
  336.  
  337. To apply the crack immediately, just make sure that branch executes.  You can do this by typing BRA right over the BNE in TMON.  If, however, you want to make a cracked, unserialized copy (which you can then serialize with anything you like) you need to figure out where code will be in Resedit and change that BNE to BRA.  Unlike the listings I have pasted into this document, TMON will tell you exactly where the code is in the file.  Refer to the above section on TMON MacNosy and Resedit for details, but essentially just find the Code Resource ID # and the offset from the TMON listing.  Then Exit TMON and let Infini-d cancel out.  Next open it the proper code resource in Resedit, scan down to the proper offset, and find the BNE (which is 66 in hex) and change it to BRA (60 in hex).  Save changes and you are set.
  338.  
  339. FrameMaker 3.0
  340.  
  341. Serial number dialog scheme again.  This one, however, presents a slight variation - Nosy won't disassemble it properly.  This means that you will have to do all your cracking from within TMON.
  342.  
  343. Step 1:  Where to start looking.
  344.  
  345. The only choice we have is to break in via TMON.  The simplest way to do this is to drop into TMON, set a Trace Interrupt for ModalDialog and Exit.  Now launch Framemaker 3.0 and wait for TMON to break in  Here is the code you would see: (note that this listing is from TMON Pro - a TMON 2.8.x listing will be slightly different)
  346.  
  347. 005B4F88:'CODE'¬Æ$0003Δí$040C+$0284 PEA      $01AA(A5)
  348. 005B4F8C:'CODE'¬Æ$0003Δí$040C+$0288 PEA      `FDEC(A6)
  349. 005B4F90:P 'CODE'¬Æ$0003Δí$040C+$2‚Ķ _ModalDialog
  350. 005B4F92:'CODE'¬Æ$0003Δí$040C+$028E MOVE.W  `FDEC(A6),D0
  351. 005B4F96:'CODE'¬Æ$0003Δí$040C+$0292 EXT.L      D0
  352. 005B4F98:'CODE'¬Æ$0003Δí$040C+$0294 MOVEQ      #$01,D1
  353. 005B4F9A:'CODE'¬Æ$0003Δí$040C+$0296 CMP.L      D0,D1
  354. 005B4F9C:'CODE'¬Æ$0003Δí$040C+$0298 BNE      ^$005B50EA          ;'CODE'¬Æ$0003Δí$040C+$3E6
  355. 005B4FA0:* 'CODE'¬Æ$0003Δí$040C+$2‚Ķ CLR.W      `FDEC(A6)
  356. 005B4FA4:'CODE'¬Æ$0003Δí$040C+$02A0 CLR.B      (A3)
  357. 005B4FA6:'CODE'¬Æ$0003Δí$040C+$02A2 TST.L      `96FA(A5)
  358. 005B4FAA:'CODE'¬Æ$0003Δí$040C+$02A6 BEQ.S      ^$005B4FC4          ;'CODE'¬Æ$0003Δí$040C+$2C0
  359. 005B4FAC:'CODE'¬Æ$0003Δí$040C+$02A8 MOVE.L  A4,-(A7)
  360. 005B4FAE:'CODE'¬Æ$0003Δí$040C+$02AA PEA      $3802              ;$000037D8+$2A
  361. 005B4FB2:'CODE'¬Æ$0003Δí$040C+$02AE JSR      $1702(A5)
  362. 005B4FB6:'CODE'¬Æ$0003Δí$040C+$02B2 MOVE.L  A3,-(A7)
  363. 005B4FB8:'CODE'¬Æ$0003Δí$040C+$02B4 MOVE.L  A4,-(A7)
  364. 005B4FBA:'CODE'¬Æ$0003Δí$040C+$02B6 JSR      $419A(A5)
  365. 005B4FBE:'CODE'¬Æ$0003Δí$040C+$02BA LEA      $0010(A7),A7
  366. 005B4FC2:'CODE'¬Æ$0003Δí$040C+$02BE BRA.S      ^$005B4FE8          ;'CODE'¬Æ$0003Δí$040C+$2E4
  367. 005B4FC4:'CODE'¬Æ$0003Δí$040C+$02C0 MOVE.L  `FDE8(A6),-(A7)
  368. 005B4FC8:'CODE'¬Æ$0003Δí$040C+$02C4 MOVEQ      #$05,D0
  369. 005B4FCA:'CODE'¬Æ$0003Δí$040C+$02C6 MOVE.W  D0,-(A7)
  370. 005B4FCC:'CODE'¬Æ$0003Δí$040C+$02C8 PEA      `FDEE(A6)
  371. 005B4FD0:'CODE'¬Æ$0003Δí$040C+$02CC PEA      `FDF0(A6)
  372. 005B4FD4:'CODE'¬Æ$0003Δí$040C+$02D0 PEA      `FDF4(A6)
  373. 005B4FD8:'CODE'¬Æ$0003Δí$040C+$02D4 _GetDItem
  374. 005B4FDA:'CODE'¬Æ$0003Δí$040C+$02D6 TST.L      `FDF0(A6)
  375. 005B4FDE:'CODE'¬Æ$0003Δí$040C+$02DA BEQ.S      ^$005B4FE8          ;'CODE'¬Æ$0003Δí$040C+$2E4
  376. 005B4FE0:'CODE'¬Æ$0003Δí$040C+$02DC MOVE.L  `FDF0(A6),-(A7)
  377. 005B4FE4:'CODE'¬Æ$0003Δí$040C+$02E0 MOVE.L  A3,-(A7)
  378. 005B4FE6:'CODE'¬Æ$0003Δí$040C+$02E2 _GetIText
  379. 005B4FE8:'CODE'¬Æ$0003Δí$040C+$02E4 MOVE.L  A3,-(A7)
  380. 005B4FEA:'CODE'¬Æ$0003Δí$040C+$02E6 JSR      ^$005B5670          ;'CODE'¬Æ$0003Δí$040C+$96C
  381. 005B4FEE:'CODE'¬Æ$0003Δí$040C+$02EA TST.L      D0
  382. 005B4FF0:'CODE'¬Æ$0003Δí$040C+$02EC ADDQ.L  #4,A7
  383. 005B4FF2:'CODE'¬Æ$0003Δí$040C+$02EE BMI      ^$005B50C8          ;'CODE'¬Æ$0003Δí$040C+$3C4
  384. 005B4FF6:'CODE'¬Æ$0003Δí$040C+$02F2 CMPI.L  #$00000005,D0
  385. 005B4FFC:'CODE'¬Æ$0003Δí$040C+$02F8 BGT      ^$005B50C8          ;'CODE'¬Æ$0003Δí$040C+$3C4
  386. 005B5000:'CODE'¬Æ$0003Δí$040C+$02FC ADD.L      D0,D0
  387. 005B5002:'CODE'¬Æ$0003Δí$040C+$02FE MOVE.W  ^$005B500A(D0.L),D0         ;'CODE'¬Æ$0003Δí$040C+$306
  388. 005B5006:'CODE'¬Æ$0003Δí$040C+$0302 JMP      ^$005B5008(D0.W)         ;'CODE'¬Æ$0003Δí$040C+$304
  389.  
  390.  
  391. If you try to step through this and enter your name etc., you will find that ModalDialog is exiting after any keystroke.  The way to get around this hassle is to get rid of the Trace Interrupt and set a breakpoint after the OK button is hit.  How you ask?  Well, take a look at the code that follows the ModalDialog.  First, D0 gets the dialog item that was modified.  Next D1 gets the value 1 and the two are compared.  From Resedit, you can find the dialog item numbers for all the items and it turns out that item 1 is the OK button, and item 5 is the serial number - these are the two important ones since the program can't proceed until the OK button is hit (we don't care about the cancel button being hit) and then the program must check the serial number.  Fol